<template>
    <uv-sticky bgColor="#fff">
        <uv-tabs :current="current" :list="list" @change="change"></uv-tabs>
        <listindex></listindex>
    </uv-sticky>
</template>

<script setup lang="ts">
import { redirectTo } from '@/util/navigator';
import listindex from './listindex.vue';
import { inject, ref, Ref } from 'vue';
import { Iuser } from '@/interface';
import { onLoad } from '@dcloudio/uni-app';
const list = [{
    name: '待反馈',
}, {
    name: '已反馈',
}]
const user = inject<Ref<Iuser>>('user')

const current = ref(0)

onLoad((option) => {
    if (option?.feedbacktime1) {
        current.value = 1
    }
})


function change(c: any) {
    if (c.name === '待反馈') {
        redirectTo(`/pages/comment/listindex2?state=待反馈&feedbackuser=${user?.value?.tenant_user_id}&show=1`)
    } else if (c.name === '已反馈') {
        redirectTo(`/pages/comment/listindex2?feedbacktime1=1&feedbackuser=${user?.value?.tenant_user_id}&show=1`)
    }
}


</script>

<style scoped></style>